<?php

namespace addons\payment\library;

use app\admin\model\payment\Channel;
use app\admin\model\payment\Order;
use think\Config;
/**
 * 支付服务类
 */
abstract class BaseService implements ServiceInterface
{
    protected $errMsg = '';

    /**
     * 渲染配置视图
     *
     * @param Model $channel 渠道实例
     * @return \think\response\View
     */
    public function configview(Channel $channel) {
        $view = new \think\View(Config::get('template'), Config::get('view_replace_str'));
        return $view->fetch(ADDON_PATH . 'payment' . DS . 'library' . DS . 'impl' . DS . $channel->service . '.html', ['config' => $channel->config]);
    }

    public function getError() {
        return $this->errMsg;
    }
}
